<%--
  Created by IntelliJ IDEA.
  User: 王德明
  Date: 2018/5/2
  Time: 17:34
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<div class="modal-header">
    <button class="close" ng-click="cancel()">
        <span aria-hidden="true">×</span>
    </button>
    <h3 class="modal-title" id="modal-title">发卡行管理</h3>
</div>

<div class="modal-body" id="modal-body">
    <div class="ibox-content no-borders tab-content">
        <!--添加-->
        <form name="myForm" class="form-horizontal formTopSpacing" ng-model="issuers" ng-show="type == 0 ">
            <!--名称-->
            <div class="form-group">
                <label class="col-sm-3 control-label formTextVerticalMiddle"><span class="text-danger">*</span>名称：</label>
                <div class="col-sm-8">
                    <input id="name" name="name" type="text" class="form-control" ng-model="issuers.name" ng-keyup="nameBlur($event,issuers.name)" required>
                </div>
            </div>
            <!--国家-->
            <div class="form-group">
                <label class="col-sm-3 control-label formTextVerticalMiddle"><span class="text-danger">*</span>国家：</label>
                <div class="col-sm-8">
                    <select class="form-control" ng-model="issuers.country" id="country" name="country" ng-blur="countryBlur($event,issuers.country)" required>
                        <option value=""></option>
                        <option ng-repeat="x in init.country" value="{{ x.firstValue }}">
                            {{ x.name }}
                        </option>
                    </select>
                </div>
            </div>
            <!-- 电话-->
            <div class="form-group">
                <label class="col-sm-3 control-label formTextVerticalMiddle"><span class="text-danger">*</span>电话：</label>
                <div class="col-sm-8">
                    <input type="text"  class="form-control" id="phone" name="phone" ng-model="issuers.phone" ng-keyup="phoneBlur($event,issuers.phone)" required>
                </div>
            </div>
            <!-- 备注-->
            <div class="form-group">
                <label class="col-sm-3 control-label formTextVerticalMiddle">备注：</label>
                <div class="col-sm-8">
                    <input type="text"  class="form-control" name="founder" ng-model="issuers.remark">
                </div>
            </div>
        </form>
        <!--更新-->
        <form name="myFormupdate" class="form-horizontal formTopSpacing" ng-model="risk" ng-show="type == 1">
            <!--名称-->
            <div class="form-group">
                <label class="col-sm-3 control-label formTextVerticalMiddle"><span class="text-danger">*</span>名称：</label>
                <div class="col-sm-8">
                    <input  name="nameupdate" type="text"  class="form-control" name="founder" ng-model="risk.name" ng-keyup="nameupdateFocus($event,risk.name)" required>
                </div>
            </div>
            <!--国家-->
            <div class="form-group">
                <label class="col-sm-3 control-label formTextVerticalMiddle"><span class="text-danger">*</span>国家：</label>
                <div class="col-sm-8">
                    <select  name="countryupdate" class="form-control" ng-model="risk.country" ng-blur="countryupdateFocus($event,risk.country)" required>
                        <option ng-repeat="x in init.country" value="{{ x.firstValue }}">
                            {{ x.name }}
                        </option>
                    </select>
                </div>
            </div>
            <!-- 电话-->
            <div class="form-group">
                <label class="col-sm-3 control-label formTextVerticalMiddle"><span class="text-danger">*</span>电话：</label>
                <div class="col-sm-8">
                    <input  name="phoneupdate" type="text"  class="form-control" name="founder" ng-model="risk.phone" ng-keyup="phoneupdateFocus($event,risk.phone)" required>
                </div>
            </div>
            <!-- 备注-->
            <div class="form-group">
                <label class="col-sm-3 control-label formTextVerticalMiddle">备注：</label>
                <div class="col-sm-8">
                    <input type="text"  class="form-control" name="founder" ng-model="risk.remark">
                </div>
            </div>
        </form>
    </div>
</div>

<div class="modal-footer">
    <row>
        <div class="col-sm-12">
            <div class="center">
                <button class="btn btn-sm btn-primary general-btn" type="button" ng-click="insertRiskIssuer(issuers,0)"
                        ng-disabled="!myForm.name.$valid || !myForm.country.$valid || !myForm.phone.$valid"
                        ng-show="type == 0">
                    确定
                </button>
                <button class="btn btn-sm btn-primary general-btn" type="button" ng-click="updateRiskIssuer(risk,1)"
                        ng-disabled="nextDisabled(myFormupdate)"
                        ng-show="type == 1">
                    确定
                </button>
            </div>
        </div>
    </row>
</div>